package com.wlz.basic;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @author wlz
 * @date 2022-07-03  3:11 下午
 */
@Slf4j
@Component
@RocketMQMessageListener(consumerGroup = "myConsumerGroup", topic = "TestTopic", consumeMode = ConsumeMode.CONCURRENTLY)
public class SpringConsumer implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        log.info(" receive message : {} ", message);
    }
}
